package com.example.demo.listener;

import org.springframework.stereotype.Component;

@Component
public class OrderMsgListener {

//    @KafkaListener(topics = "order",groupId = "order-service")
//    public void listen(ConsumerRecord record){
//        System.out.println("收到消息："+record); //可以监听到发给kafka的新消息，以前的拿不到
//    }
//
//    @KafkaListener(groupId = "order-service-2",topicPartitions = {
//            @TopicPartition(topic = "order",partitionOffsets = {
//                    @PartitionOffset(partition = "0",initialOffset = "0")
//            })
//    })
//    public void listenAll(ConsumerRecord record){
//        System.out.println("收到partition-0消息："+record);
//    }
}